Project Summary/Abstract In response to new sensory stimuli, an animal must decide what to do next. Escape behaviors are excellent models with which to study the neurobiological basis of behavior because they are essential and interpretable. Here we propose to study neural factors which influence a probabilistic behavior where C. elegans escapes stimulation of an aversive sensory neuron ASH. Specifically we will determine how much variance in behavior is accounted for by ongoing global neural dynamics i.e. time-varying patterns of activity which encode major behaviors such as forward, backward, dorsal, and ventral crawling. During dynamics, a given neuron receives different levels of excitation and inhibition from its synaptic partners, which may contribute to behaviors seeming probabilistic. During whole-brain imaging with cellular resolution to access the activity of the entire brain of the animal simultaneously, we will optogenetically stimulate neurons during signatures of activity correlated with crawling behaviors using a closed-loop calcium imaging quantification and optogenetic stimulation platform to perturb dynamics. We will characterize how stimulus intensity and dynamics interact to activate sensory and downstream neurons. We will also examine a variable forward or reversal behavior which emerges when worms are disturbed from a state with no obvious dynamics, sleep. We will characterize how neurons respond to different intensities of stimulation and fit physiology data to a model relating activation function and action selection. Taken together these experiments use a simple animal model to shed light on how evoked neuronal activity is modulated by ongoing patterns throughout the network. These experiments emphasize a distributed view of sensory and motor representations and explore its implications on dynamics in a highly interconnected nervous system. This research and training plan in this proposal is decidedly hybrid experimental and computational, necessarily guided by two leaders in each discipline at the famously collaborative University of California, San Francisco.